package lee.vioson.remotedata.bean

/**
 *Author:viosonlee
 *Date:2023/6/16
 *DESCRIPTION:
 */
data class BookData(
    val bookInfo: Book,
    val chapterList: List<Chapter>,
    val isCollect: Int,
) {
    val isCollection: Boolean
        get() = isCollect == 1
}

data class Chapter(
    val id: String,
    val bookId: String,
    val chapterName: String,
    val coverPhoto: String,
    val chapterNum: Int,
    val bookDesc: String,
    val isVip: Int,
    val lastUpdateDate: Long,
    val isLaunch: Int,
) {

    override fun equals(other: Any?): Boolean {
        if (this === other) return true
        if (javaClass != other?.javaClass) return false

        other as Chapter

        if (id != other.id) return false
        if (bookId != other.bookId) return false

        return true
    }

    override fun hashCode(): Int {
        var result = id.hashCode()
        result = 31 * result + bookId.hashCode()
        return result
    }

}



